package com.hmall.mapper;

import com.hmall.model.MallProductPlanItem;
import com.hmall.util.MyMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface MallProductPlanItemMapper extends MyMapper<MallProductPlanItem> {
    void myInsert(@Param("planNo") long planNo, @Param("productId") Integer productId, @Param("grade") String grade, @Param("amount") Integer amount
            , @Param("residualQuantity") Integer residualQuantity);

    List<Integer> selectByPlanNo(@Param("planNo") long planNo);

    List<MallProductPlanItem> listProductPlanItemByPlanNoList(@Param("planNoList") List<Long> planNoList);

    void batchDelete(@Param("planNo") long planNo);

    List<MallProductPlanItem> listProductPlanItemByPlanNo(@Param("planNo") Long planNo);

    void updateByTreeAttr(@Param("planItemId") Integer planItemId, @Param("productId") Integer productId,
                          @Param("grade") String grade, @Param("weight") Integer weight);

    void deleteByPlanNo(@Param("planNo") Long planNo);

    int selectCountByProductPlanNo(@Param("planNo") Long planNo);

    void updateResidualQuantity(@Param("residualQuantity") BigDecimal residualQuantity, @Param("planItemId") Integer planItemId);
}